package com.china.lottery.listener.service;

import org.java_websocket.WebSocket.READYSTATE;

public enum WebClientEnum {
	CLIENT;  
    
      
    public static void initClient(MsgWebSocketClient client , String requestText) {  
    	    
    	    if(client.getReadyState().equals(READYSTATE.OPEN)){
    	    	  client.send(requestText); 
    	    }else{
    	    	  client.connect();  
    	            
    	          while(!client.getReadyState().equals(READYSTATE.OPEN)){
    	    	    	System.out.println("__"+client.getReadyState()+"__");
    	    	   }
    	          client.send(requestText); 
    	    }
    	   
            
   }  
}
